diff options
| author | Adam Soltys <[email protected]> | 2022-11-03 14:00:14 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-11-03 14:00:18 -0700 |
| commit | d608c466c30019c4cc7d038f2308ac0e5b204841 (patch) | |
| tree | 1b9e230702431fd4cde777c4b242703b067dc12e /src/routes/(app)/[username] | |
| parent | aa1f1cf0832c70c66b84cfe5e1bb2912a704fea3 (diff) | |
| download | coinos-ui-d608c466c30019c4cc7d038f2308ac0e5b204841.tar.gz coinos-ui-d608c466c30019c4cc7d038f2308ac0e5b204841.zip | |
invoice requests
Diffstat (limited to 'src/routes/(app)/[username]')
| -rw-r--r-- | src/routes/(app)/[username]/+page.svelte | 40 | ||||
| -rw-r--r-- | src/routes/(app)/[username]/settings/+page.server.js | 14 |
2 files changed, 33 insertions, 21 deletions
diff --git a/src/routes/(app)/[username]/+page.svelte b/src/routes/(app)/[username]/+page.svelte index 78e9a9d3..6bab769b 100644 --- a/src/routes/(app)/[username]/+page.svelte +++ b/src/routes/(app)/[username]/+page.svelte @@ -44,23 +44,19 @@ {subject.address && subject.address !== 'null' ? subject.address : ''} </p> - <div class="flex gap-2"> - <button - class="border rounded-full py-2 w-28 font-semibold flex justify-center items-center text-sm" - on:click={() => (followed = !followed)} - ><Icon icon={followed ? 'minus' : 'plus'} style="mr-1" /> - {$t('user.' + (followed ? 'following' : 'follow'))} - </button> + <div class="menu"> + <button on:click={() => (followed = !followed)}> + {$t('user.' + (followed ? 'following' : 'follow'))} + </button> - <a href={`/${subject.username}/receive`}> - <button - class="border rounded-full py-2 w-28 font-semibold flex justify-center items-center text-sm" - > - <Icon icon="send" style="mr-1" /> - Pay - </button> - </a> - </div> + <a href={`/${subject.username}/receive`}> + <button> Pay </button> + </a> + + <a href={`/${subject.username}/request`}> + <button> Request invoice </button> + </a> + </div> </div> <div class="space-y-5 md:mt-20 mx-auto w-[350px]"> @@ -70,9 +66,9 @@ class="cursor-pointer w-[292px] md:w-[342px] h-[342px] border border-lightgrey rounded-3xl flex p-5 justify-center items-center relative mx-auto" /> - <div class="bg-primary font-semibold rounded-xl text-sm p-3 flex justify-between items-center"> - <span class="mx-auto">{lightningAddress}</span> - <button class="hover:opacity-80" on:click={() => copy(lightningAddress)}> + <div class="bg-primary font-semibold rounded-xl text-sm p-3 flex"> + <div class="my-auto">{lightningAddress}</div> + <button class="ml-auto hover:opacity-80" on:click={() => copy(lightningAddress)}> <Icon icon="copy" style="ml-2" /> </button> </div> @@ -86,3 +82,9 @@ </p> </div> </div> + +<style> + .menu button { + @apply w-full mt-2 bg-primary text-black hover:bg-black hover:text-white font-semibold py-5 px-7 rounded-2xl; + } +</style> diff --git a/src/routes/(app)/[username]/settings/+page.server.js b/src/routes/(app)/[username]/settings/+page.server.js index ae7e0a78..bf5661f6 100644 --- a/src/routes/(app)/[username]/settings/+page.server.js +++ b/src/routes/(app)/[username]/settings/+page.server.js @@ -1,12 +1,22 @@ import { invalid } from '@sveltejs/kit'; import { auth, get, post } from '$lib/utils'; +import Qr from 'qrcode-base64'; + +export async function load({ locals: { user } }) { + return { + otpQr: Qr.drawImg( + `otpauth://totp/coinos:${user.username}?secret=${user.otpsecret}&period=30&digits=6&algorithm=SHA1&issuer=coinos`, + { size: 600 } + ) + }; +} export const actions = { - default: async ({ cookies, request }) => { + default: async ({ cookies, locals, request }) => { let form = Object.fromEntries(await request.formData()); let user = { - ...(await get('/me', auth(cookies))), + ...locals.user, ...form }; |
